package org.wevil.controller;

import org.wevil.util.DateUtil;
import org.wevil.util.RequestUtil;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/** 临时测试用 */
@RestController
@RequestMapping("middleWare/plate")
public class TempController {

    @PostMapping
    public String doPost(HttpServletRequest request) {
        String data = RequestUtil.request2Str(request);
        System.out.println(DateUtil.getDateStr() + " : 接收数据：" + data);
        return data;
    }

    /**
     * 接收车牌识别心跳数据，
     * 要加入白名单
     *
     * @author wanglei
     * @since 2023/9/21
     * */
    @PostMapping("heart")
    public String heart(HttpServletRequest request) {
        String serialno = request.getParameter("serialno");
        System.out.println(DateUtil.getDateStr() + " : 接收到心跳数据：" + serialno);
        return serialno;
    }
}
